Skip to content

feat: stdlib::Proof#15410

Merged
ledwards2225 merged 4 commits into
merge-train/barretenbergfrom
lde/stdlib_proof
Jul 1, 2025
Merged

feat: stdlib::Proof#15410
ledwards2225 merged 4 commits into
merge-train/barretenbergfrom
lde/stdlib_proof

Conversation

@ledwards2225

@ledwards2225 ledwards2225 commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

Introduce a simple stdlib::Proof class to replace StdlibProof (which was just an alias for std::vector<bb::stdlib::field_t<Builder>>;). This is more idiomatic and improves the related syntax, e.g. convert_native_proof_to_stdlib(&circuit, proof); is replaced by a constructor and convert_stdlib_proof_to_native is replaced by get_value() (as is the convention for stdlib objects).

@ledwards2225 ledwards2225 changed the base branch from next to merge-train/barretenberg June 30, 2025 21:20
@ledwards2225 ledwards2225 marked this pull request as ready for review June 30, 2025 23:10
// its a proof that will be checked anyway.
final_ipa_proof = convert_stdlib_proof_to_native(nested_ipa_proofs[0]);
final_ipa_proof = nested_ipa_proofs[0].get_value();
} else if (nested_ipa_claims.size() == 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment: my editor complains that we don't use nested_ipa_claims.empty()

using Flavor = avm2::AvmRecursiveFlavor_<Builder>;
using RecursiveVerificationKey = Flavor::VerificationKey;
using RecursiveVerifier = avm2::AvmRecursiveVerifier_<Flavor>;
using field_ct = stdlib::field_t<Builder>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we need to define the alias here even though it's already defined at line 28?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its bad practice to define type aliases at the level of the namespace, which this file does. I've gotten rid of this for now since its a larger issue that can be handled at some other time

using PCS = typename Flavor::PCS;
using Transcript = bb::BaseTranscript<bb::stdlib::recursion::honk::StdlibTranscriptParams<Builder>>;
using VerifierCommitments = typename Flavor::VerifierCommitments;
using StdlibIPAProof = bb::stdlib::Proof<Builder>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use this alias only in the hpp file, in the cpp we use the explicit type declaration. Do we want to get rid of the alias?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, updated both files to just use StdlibProof

PairingAccumulator points_accumulator;
OpeningClaim<Curve> opening_claim;
StdlibProof<Builder> ipa_proof;
stdlib::Proof<Builder> ipa_proof;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In contrast to eccvm_recursive_verifier here we have no alias

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally dont define an alias if there is only a single usage unless it significantly improves readability

@federicobarbacovi federicobarbacovi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Only a few minor comments. Great change, it makes the code more standardised.

@ledwards2225 ledwards2225 merged commit 64fd713 into merge-train/barretenberg Jul 1, 2025
4 checks passed
@ledwards2225 ledwards2225 deleted the lde/stdlib_proof branch July 1, 2025 13:50
ledwards2225 added a commit that referenced this pull request Jul 1, 2025
ludamad pushed a commit that referenced this pull request Jul 1, 2025
This reverts commit 64fd713.

Please read [contributing guidelines](CONTRIBUTING.md) and remove this
line.
ledwards2225 added a commit that referenced this pull request Jul 1, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Jul 2, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

chore: update merge-train documentation
feat!: (sequence of) Apps share a transcript until a kernel is
encountered (#15313)
chore: bigfield todo fixes (#15202)
chore: remove insecure logic from ipa recursion (#14102)
chore: bigfield audit fixes that change circuits (#15205)
feat: stdlib::Proof (#15410)
fix: build bb for bench_ivc script (#15429)
chore: revert "feat: stdlib::Proof (#15410)" (#15431)
chore: unrevert stdlib proof (#15443)
chore: package vk hash with vk (#15318)
chore: fix avm build (#15448)
chore: skip building wasm for bench_ivc when NO_WASM=1 (#15462)
chore: add a link to audit PR template in default PR template (#15463)

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com>
Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com>
Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
Co-authored-by: Lucas Xia <lucasxia01@gmail.com>
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jul 16, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

chore: update merge-train documentation
feat!: (sequence of) Apps share a transcript until a kernel is
encountered (AztecProtocol#15313)
chore: bigfield todo fixes (AztecProtocol#15202)
chore: remove insecure logic from ipa recursion (AztecProtocol#14102)
chore: bigfield audit fixes that change circuits (AztecProtocol#15205)
feat: stdlib::Proof (AztecProtocol#15410)
fix: build bb for bench_ivc script (AztecProtocol#15429)
chore: revert "feat: stdlib::Proof (AztecProtocol#15410)" (AztecProtocol#15431)
chore: unrevert stdlib proof (AztecProtocol#15443)
chore: package vk hash with vk (AztecProtocol#15318)
chore: fix avm build (AztecProtocol#15448)
chore: skip building wasm for bench_ivc when NO_WASM=1 (AztecProtocol#15462)
chore: add a link to audit PR template in default PR template (AztecProtocol#15463)

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com>
Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com>
Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
Co-authored-by: Lucas Xia <lucasxia01@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants